#ifndef _STRING_H_
#define _STRING_H_

#include "interface.h"

#define String_DEF \
char *ptr; \
unsigned int length;

#define String_SHARED \
FN(int, setPChar, const char *ptr); \
FN(int, setNPChar, const char *ptr, unsigned int len); \
FN(int, setString, String *str); \
FN(char *, pchar); \
FN(int, isEmpty); \
FN(String *, substring, int from, int to); \
FN(String *, trim); \
FN(String *, pre, unsigned int len); \
FN(String *, pos, unsigned int len); \
FN(int, startsPChar, const char *ptr); \
FN(int, startsString, String *str); \
FN(int, startsPCharIgnoreCase, const char *ptr); \
FN(int, startsStringIgnoreCase, String *str); \
FN(int, endsPChar, const char *ptr); \
FN(int, endsString, String *str); \
FN(int, endsPCharIgnoreCase, const char *ptr); \
FN(int, endsStringIgnoreCase, String *str); \
FN(int, findPChar, const char *ptr); \
FN(int, findString, String *str); \
FN(String *, toLow); \
FN(String *, toUp); \
FN(String *, appendPChar, const char *ptr); \
FN(String *, appendString, String *str); \
FN(String *, prependPChar, const char *ptr); \
FN(String *, prependString, String *str); \
FN(int, compareToPChar, const char *ptr); \
FN(int, compareToIgnoreCase, String *str); \
FN(int, compareToPCharIgnoreCase, const char *ptr); \
FN(String *, replace, const char *from, const char *to); \
FN(String *, replaceAll, const char *from, const char *to); \
FN(unsigned int, length);

#define String_EXCLUSIVE

BUILD_OBJ(String)

#endif
